<template>
  <div id="temp"></div>
  <h2 div="title1">欢迎进入编程导航！！</h2>
  <a-form
    style="max-width: 480px; margin: 0 auto"
    :model="formState"
    name="basic"
    :label-col="{ span: 8 }"
    :wrapper-col="{ span: 16 }"
    autocomplete="off"
    @finish="onFinish"
    @finishFailed="onFinishFailed"
  >
    <a-form-item
      class="move-down"
      label="账号"
      name="userAccount"
      :rules="[{ required: true, message: '请输入账号' }]"
    >
      <a-input
        v-model:value="formState.userAccount"
        aria-placeholder="请输入账号"
      />
    </a-form-item>

    <a-form-item
      class="move-down"
      label="密码"
      name="password"
      :rules="[{ required: true, message: '请输入密码' }]"
    >
      <a-input-password
        v-model:value="formState.password"
        aria-placeholder="请输入密码"
      />
    </a-form-item>

    <a-form-item :wrapper-col="{ offset: 8, span: 16 }">
      <a-button type="primary" html-type="submit">Submit</a-button>
    </a-form-item>
  </a-form>
</template>

<script lang="ts" setup>
import { reactive } from "vue";

interface FormState {
  userAccount: string;
  password: string;
}

const formState = reactive<FormState>({
  userAccount: "",
  password: "",
});
const onFinish = (values: any) => {
  console.log("Success:", values);
};

const onFinishFailed = (errorInfo: any) => {
  console.log("Failed:", errorInfo);
};
</script>

<style scoped>
#userLoginPage {
  text-align: center;
  margin-bottom: 16px;
}

.move-down {
  margin-top: 10px;
}
</style>
